<html>
    <head>
        <meta charset="UTF-8">
        <title>Jquery测试</title>
        <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script
    </head>
    <body>
        <div id="app">
            <h1>{{ imageVisible }}</h1>
            <button @click="imageVisible=!imageVisible">
                {{imageVisible==true?'隐藏':'显示'}}
            </button>
            <br>
            <img v-if="imageVisible==true" src="1.jpg">
        </div>
        <script>
            const { createApp, ref } = Vue
      
            createApp({
              setup() {
                //响应式变量
                const imageVisible = ref(true)
                return {
                    imageVisible
                }
              }
            }).mount('#app')
        </script>
    </body>
</html>